
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" %>
<html>
<head>
    <title>查 看 优 惠 劵</title>
    <link rel="stylesheet" href="/TakeawaySystem/css/Show.css" type="text/css">
</head>
<body>
<table id="name-label">
    <tr>
        <td align="center" colspan="4">你好！${user.username}
            <a href="/TakeawaySystem/jsp/UserCenter.jsp">返回</a>  </td>
    </tr>
</table>
<table>
    <tr>
        <td id= "tableTopic">
            优 惠 劵 大 全
        </td>
    </tr>
    <c:if test="${coupons.size()>0}">

        <c:forEach begin="0" end="${coupons.size()-1}" var="i">

            <form id="bookForm" method="post">
                <tr>
                    <td class="shopTopic">
                        店名：${shops[i].shopName}

                    </td>
                </tr>
                <tr>
                    <td class="description">
                        到期时间：${coupons[i].expirationTime}
                    </td>
                </tr>
                <td>
                    <input type="hidden" value="${coupons[i].id}" name="couponId">
                    <input Type="submit" id="delete" name="delete" Value="删 除" >
                </td>
            </form>
        </c:forEach>
    </c:if>
</table>
</body>
<script>
    let delete_ = document.getElementById("delete");
    delete_.onclick = deleteCart;
    function deleteCart()
    {
        document.getElementById("bookForm").action="deleteCoupon";
        document.getElementById("bookForm").submit();
    }
</script>
</html>
